home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ObjectInput.java < prev    next >
Text File  |  1998-09-22  |  4KB  |  103 lines

  1. /*
  2.  * @(#)ObjectInput.java    1.9 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  * ObjectInput extends the DataInput interface to include the writing of
  19.  * objects. DataInput includes methods for the input of primitive types, 
  20.  * ObjectInput extends that interface to include objects, arrays, and Strings.
  21.  *
  22.  * @author  unascribed
  23.  * @version 1.9, 07/01/98
  24.  * @see java.io.InputStream
  25.  * @see java.io.ObjectOutputStream
  26.  * @see java.io.ObjectInputStream
  27.  * @since   JDK1.1
  28.  */
  29. public interface ObjectInput extends DataInput {
  30.     /**
  31.      * Read and return an object. The class that implements this interface
  32.      * defines where the object is "read" from.
  33.      *
  34.      * @exception java.lang.ClassNotFoundException If the class of a serialized 
  35.      *      object cannot be found.
  36.      * @exception IOException If any of the usual Input/Output
  37.      * related exceptions occur.
  38.      * @since     JDK1.1
  39.      */
  40.     public Object readObject()
  41.     throws ClassNotFoundException, IOException;
  42.  
  43.     /**
  44.      * Reads a byte of data. This method will block if no input is 
  45.      * available.
  46.      * @return     the byte read, or -1 if the end of the
  47.      *        stream is reached.
  48.      * @exception IOException If an I/O error has occurred.
  49.      * @since     JDK1.1
  50.      */
  51.     public int read() throws IOException;
  52.  
  53.     /**
  54.      * Reads into an array of bytes.  This method will
  55.      * block until some input is available.
  56.      * @param b    the buffer into which the data is read
  57.      * @return  the actual number of bytes read, -1 is
  58.      *         returned when the end of the stream is reached.
  59.      * @exception IOException If an I/O error has occurred.
  60.      * @since     JDK1.1
  61.      */
  62.     public int read(byte b[]) throws IOException;
  63.  
  64.     /**
  65.      * Reads into an array of bytes.  This method will
  66.      * block until some input is available.
  67.      * @param b    the buffer into which the data is read
  68.      * @param off the start offset of the data
  69.      * @param len the maximum number of bytes read
  70.      * @return  the actual number of bytes read, -1 is
  71.      *         returned when the end of the stream is reached.
  72.      * @exception IOException If an I/O error has occurred.
  73.      * @since     JDK1.1
  74.      */
  75.     public int read(byte b[], int off, int len) throws IOException;
  76.  
  77.     /**
  78.      * Skips n bytes of input.
  79.      * @param n the number of bytes to be skipped
  80.      * @return    the actual number of bytes skipped.
  81.      * @exception IOException If an I/O error has occurred.
  82.      * @since     JDK1.1
  83.      */
  84.     public long skip(long n) throws IOException;
  85.  
  86.     /**
  87.      * Returns the number of bytes that can be read
  88.      * without blocking.
  89.      * @return the number of available bytes.
  90.      * @since     JDK1.1
  91.      */
  92.     public int available() throws IOException;
  93.  
  94.     /**
  95.      * Closes the input stream. Must be called
  96.      * to release any resources associated with
  97.      * the stream.
  98.      * @exception IOException If an I/O error has occurred.
  99.      * @since     JDK1.1
  100.      */
  101.     public void close() throws IOException;
  102. }
  103.